package com.example.demo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
public class User {
    @NotEmpty(message = "用户名不能为空", groups = {UserValidationGroup1.class, UserValidationGroup2.class})
    private String username;
    @NotNull(message = "id不能为空", groups = {UserValidationGroup1.class})
    private Integer id;
    @NotEmpty(message = "地址不能为空", groups = {UserValidationGroup1.class})
    private String address;
    @NotEmpty(message = "性别不能为空", groups = {UserValidationGroup1.class})
    private String gender;
}
